package persistencia;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import util.Conexion;
import bean.Auditoria;

public class AuditoriaDAO {

	public void insertarAuditoria(Auditoria auditoria) throws SQLException {

		PreparedStatement pstm = null;
		pstm = Conexion
				.obtenerConexionPRUEBA()
				.prepareStatement(
						"INSERT INTO TAUDITORIA (COD_AUD,USU,FECHA,TIPO_OPE,CANT_REG,MODULO,MENU,OPCION,REF1,REF2,REF3,REF4," +
						"REF5,REF6,REF7,REF8,REF9,REF10,REF11,REF12,REF13,REF14,REF15,REF16,REF17,REF18,REF19,REF20,REF21," +
						"REF22,REF23,REF24,REF25,REF26,REF27,REF28,REF29,REF30,REF31,REF32,REF33,REF34,REF35,REF36,REF37,REF38,"+
						"REF39,REF40,REF41,REF42,REF43,REF44,REF45,REF46,REF47,REF48,REF49,REF50) values(NEXT VALUE FOR " +
						"PRUEBA.CODAUDITORIA,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
		pstm.setString(1, auditoria.getUsu());
		pstm.setTimestamp(2, auditoria.getFecha());
		pstm.setString(3, auditoria.getTipo_ope());
		pstm.setInt(4, auditoria.getCant_reg());
		pstm.setString(5, auditoria.getModulo());
		pstm.setString(6, auditoria.getMenu());
		pstm.setString(7, auditoria.getOpcion());
		pstm.setString(8, auditoria.getRef1());
		pstm.setString(9, auditoria.getRef2());
		pstm.setString(10, auditoria.getRef3());
		pstm.setString(11, auditoria.getRef4());
		pstm.setString(12, auditoria.getRef5());
		pstm.setString(13, auditoria.getRef6());
		pstm.setString(14, auditoria.getRef7());
		pstm.setString(15, auditoria.getRef8());
		pstm.setString(16, auditoria.getRef9());
		pstm.setString(17, auditoria.getRef10());
		pstm.setString(18, auditoria.getRef11());
		pstm.setString(19, auditoria.getRef12());
		pstm.setString(20, auditoria.getRef13());
		pstm.setString(21, auditoria.getRef14());
		pstm.setString(22, auditoria.getRef15());
		pstm.setString(23, auditoria.getRef16());
		pstm.setString(24, auditoria.getRef17());
		pstm.setString(25, auditoria.getRef18());
		pstm.setString(26, auditoria.getRef19());
		pstm.setString(27, auditoria.getRef20());
		pstm.setString(28, auditoria.getRef21());
		pstm.setString(29, auditoria.getRef22());
		pstm.setString(30, auditoria.getRef23());
		pstm.setString(31, auditoria.getRef24());
		pstm.setString(32, auditoria.getRef25());
		pstm.setString(33, auditoria.getRef26());
		pstm.setString(34, auditoria.getRef27());
		pstm.setString(35, auditoria.getRef28());
		pstm.setString(36, auditoria.getRef29());
		pstm.setString(37, auditoria.getRef30());
		pstm.setString(38, auditoria.getRef31());
		pstm.setString(39, auditoria.getRef32());
		pstm.setString(40, auditoria.getRef33());
		pstm.setString(41, auditoria.getRef34());
		pstm.setString(42, auditoria.getRef35());
		pstm.setString(43, auditoria.getRef36());
		pstm.setString(44, auditoria.getRef37());
		pstm.setString(45, auditoria.getRef38());
		pstm.setString(46, auditoria.getRef39());
		pstm.setString(47, auditoria.getRef40());
		pstm.setString(48, auditoria.getRef41());
		pstm.setString(49, auditoria.getRef42());
		pstm.setString(50, auditoria.getRef43());
		pstm.setString(51, auditoria.getRef44());
		pstm.setString(52, auditoria.getRef45());
		pstm.setString(53, auditoria.getRef46());
		pstm.setString(54, auditoria.getRef47());
		pstm.setString(55, auditoria.getRef48());
		pstm.setString(56, auditoria.getRef49());
		pstm.setString(57, auditoria.getRef50());
		pstm.executeUpdate();
		
		pstm.close();
		Conexion.obtenerConexionPRUEBA().close();
	}

}
